package cn.com.yiqi.wsc.entity.shop;

import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Date;

public class AppSubjectItem {
    /**
    * 主键id
    */
    private Integer id;

    /**
    * 专题id
    */
    private Integer subjectId;

    /**
    * 专题商品id
    */
    private Integer itemId;

    /**
    * 专题图片
    */
    private String picUrl;

    /**
     * 专题对应商品的图片
     * */
    private String itemPic;

    /**
    * 排序
    */
    private Integer sort;

    /**
    * 卖出数量
    */
    private Integer soldCount;

    /**
    * 卖出金额
    */
    private BigDecimal soldAmount;

    /**
    * 新增时间
    */
    private Date insertTime;

    /**
    * 新增用户id
    */
    private Integer insertUserId;

    /**
    * 修改时间
    */
    private Date updateTime;

    /**
    * 修改用户id
    */
    private Integer updateUserId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(Integer subjectId) {
        this.subjectId = subjectId;
    }

    public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }

    public String getPicUrl() {
        return picUrl;
    }

    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getSoldCount() {
        return soldCount;
    }

    public void setSoldCount(Integer soldCount) {
        this.soldCount = soldCount;
    }

    public BigDecimal getSoldAmount() {
        return soldAmount;
    }

    public void setSoldAmount(BigDecimal soldAmount) {
        this.soldAmount = soldAmount;
    }

    public Date getInsertTime() {
        return insertTime;
    }

    public void setInsertTime(Date insertTime) {
        this.insertTime = insertTime;
    }

    public Integer getInsertUserId() {
        return insertUserId;
    }

    public void setInsertUserId(Integer insertUserId) {
        this.insertUserId = insertUserId;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(Integer updateUserId) {
        this.updateUserId = updateUserId;
    }

    public String getItemPic() {
        return itemPic;
    }

    public void setItemPic(String itemPic) {
        this.itemPic = itemPic;
    }

    public void initUrl(String url) {
        if(StringUtils.isNotEmpty(itemPic)){
            itemPic = url + "/" +itemPic ;
        }
        if(StringUtils.isEmpty(picUrl)){
            picUrl = "/" + url +picUrl ;
        }
    }
}